'''
Created on 29.07.2010

@author: Valiuh Anton - valiuh@gmail.com

        This program use simple facial detection method 
        that based on skin color model. Program do not used 
        any omputer vision library like OpenCV, or other 
        learning based classifier such as Haar-like features, 
        neural network etc. You can find more detailed description 
        of the method here - 
        http://blogs.msdn.com/b/coding4fun/archive/2010/03/24/9984015.aspx   
        
        Good luck!
                                               
'''
    
import Image
from VideoCapture import Device
from PreImage import PreImage 
from FindFaces import FindFaces

if __name__ == '__main__':
   
    cam = Device()
    print "\t==== Camera initial ok ===="
    input_buf = cam.getImage()
    print "\t==== Getting image ok ===="
    image=input_buf.resize((100,80))   
    print "\t==== Resizing image ok ===="
            
    #image = Image.open("me.jpg").convert("RGB") 
    #image=image.resize((100,80))
    
    filterYCbCr= PreImage(image)
    filterYCbCr.convert('w','YCbCr')
    filterYCbCr.grey_scale('w','YCbCr')
    
    faces = FindFaces(filterYCbCr.output_YCbCr_grey_scale,image)
    faces.Face()   
    
         
    
    
    
    
    
    
    
    

    
    
   
    
    